<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Setting up the TwistedQuotes application</title>

</head>

<body>

<h1>Setting up the TwistedQuotes application</h1>

<h2>Goal</h2>

<p>This document describes how to set up the TwistedQuotes application used in
a number of other documents, such as <a href="design.xhtml">designing Twisted applications</a>.</p>

<h2>Setting up the TwistedQuotes project directory</h2>

<p>In order to run the Twisted Quotes example, you will need to do the
following:</p>

<ol>
<li>Make a <code>TwistedQuotes</code> directory on your system</li>
<li>Place the following files in the <code>TwistedQuotes</code> directory:
    <ul>
    <li><a href="listings/TwistedQuotes/__init__.py" class="py-listing">__init__.py</a> (this
        file marks it as a package, see <a
        href="http://docs.python.org/tutorial/modules.html#packages"
        >this section</a> of the Python tutorial for more on packages)</li>
    <li><a href="listings/TwistedQuotes/quoters.py" class="py-listing">quoters.py</a></li>
    <li><a href="listings/TwistedQuotes/quoteproto.py" class="py-listing">quoteproto.py</a></li>
    </ul>
</li>
<li>Add the <code>TwistedQuotes</code> directory's <em>parent</em> to your Python
path. For example, if the TwistedQuotes directory's path is
 <code>/mystuff/TwistedQuotes</code> or <code>c:\mystuff\TwistedQuotes</code>
add <code>/mystuff</code> to your Python path. On UNIX this would be <code
class="shell">export PYTHONPATH=/mystuff:$PYTHONPATH</code>, on Microsoft
Windows change the <code class="shell">PYTHONPATH</code> variable through the
Systems Properties dialog by adding <code class="shell">;c:\mystuff</code> at the
end.</li>
<li>
Test your package by trying to import it in the Python interpreter:
<pre class="python-interpreter">
Python 2.1.3 (#1, Apr 20 2002, 22:45:31)
[GCC 2.95.4 20011002 (Debian prerelease)] on linux2
Type "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import TwistedQuotes
&gt;&gt;&gt; # No traceback means you're fine.
</pre>
</li>
</ol>

</body>

</html>
